/*!
 * \file iconv2utf8.h
 *
 * \brief 将源数据根据其charset转换成UTF8
 *
 * All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.\n
 * 将源数据根据其charset转换成UTF8
 *
 * \version 2.0
 * \author zhengxd
 * \date 2014/10/01
 *
 */

#ifndef __ICONV2UTF8_H_
#define __ICONV2UTF8_H_

/*!
 * 将源数据根据其charset转换成UTF8
 *
 * \param p_inbuffer         (源数据)
 * \param ui_inbuffer_size   (源数据长度)
 * \param p_from_charset     (源数据charset)
 * \param pp_output_buffer   (转换后UTF8数据)
 * \param p_ui_output_size   (转换后UTF8数据长度)
 *
 * \return 0:成功\n
 *         1:有不可转换字符\n
 *         2:其他错误
 *
 * \note 当返回值是0或者1时都得释放pp_output_buffer
 *
 */
int iconv_to_utf8(char *p_inbuffer
                  , unsigned int ui_inbuffer_size
                  , const char *p_from_charset
                  , char **pp_output_buffer
                  , unsigned int *p_ui_output_size);

#endif
